package com.example.demo.controller;

import com.example.demo.vo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.servlet.http.HttpServletResponse;

/**
 * @author zhangfc
 * @date 2022/3/29 14:57
 */
@RestController
@RequestMapping("/test")
public class TestController {

    private final RestTemplate restTemplate;

    public TestController(RestTemplate restTemplate) {
        this.restTemplate = restTemplate;
    }


    @GetMapping("/get")
    public void test01(HttpServletResponse response) {
        System.out.println("get");
        response.setStatus(200);
    }

    @GetMapping("/test02")
    public User test02() {
        return User.builder()
                .userName("zhangsa")
                .passWord(null)
                .build();
    }
}
